import Vue from 'vue'
import Router from 'vue-router'
import {
    routes
} from './routerIn.js'
import {
    Row,
    Col,
    Input,
    InputNumber,
    Button,
    Pagination,
    DatePicker,
    Dialog,
    Form,
    FormItem,
    Table,
    TableColumn,
    Tooltip,
    Menu,
    MenuItem,
    Submenu,
    Upload,
    Checkbox,
    CheckboxGroup,
    Select,
    Option,
    MessageBox,
    Message,
    Switch,
    Radio,
    Tabs,
    TabPane,
    Autocomplete,
    Carousel,
    CarouselItem,
    Breadcrumb,
    BreadcrumbItem,
} from 'element-ui'
Vue.component(Row.name, Row)
Vue.component(Col.name, Col)
Vue.component(Input.name, Input)
Vue.component(InputNumber.name, InputNumber)
Vue.component(Button.name, Button)
Vue.component(Pagination.name, Pagination)
Vue.component(DatePicker.name, DatePicker)
Vue.component(Dialog.name, Dialog)
Vue.component(Form.name, Form)
Vue.component(FormItem.name, FormItem)
Vue.component(Table.name, Table)
Vue.component(TableColumn.name, TableColumn)
Vue.component(Tooltip.name, Tooltip)
Vue.component(Menu.name, Menu)
Vue.component(MenuItem.name, MenuItem)
Vue.component(Submenu.name, Submenu)
Vue.component(Upload.name, Upload)
Vue.component(Checkbox.name, Checkbox)
Vue.component(CheckboxGroup.name, CheckboxGroup)
Vue.component(Select.name, Select)
Vue.component(Option.name, Option)
Vue.component(Switch.name, Switch)
Vue.component(Radio.name, Radio)
Vue.component(Tabs.name, Tabs)
Vue.component(TabPane.name, TabPane)
Vue.component(Autocomplete.name, Autocomplete)
Vue.component(Carousel.name, Carousel)
Vue.component(CarouselItem.name, CarouselItem)
Vue.component(Breadcrumb.name, Breadcrumb)
Vue.component(BreadcrumbItem.name, BreadcrumbItem)

Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$prompt = MessageBox.prompt
Vue.prototype.$message = Message
Vue.use(Router)
const router = new Router({
    // mode: 'history',
    routes,
    scrollBehavior: () => ({ // 滚动条滚动的行为，不加这个默认就会记忆原来滚动条的位置
        y: 0
    }),
})
export default router
